const fs = require('fs')
const util = require ('util')
const writeFile = util.promisify (fs.writeFile)
const vueConfig = require('./vue.config.js')



let arg = process.argv.slice(2)
let publicPath = arg[0]
let apiUrl = arg[1]

let conf = fs.readFileSync('./vue.config.js','utf-8')
publicPath = `process.env.NODE_ENV === 'development' ? '/' : '${publicPath}wap/'` 

conf = conf.replace(/publicPath:(.*?)[,]/,(a,key, val)=>{
     return `publicPath:${publicPath},`
})

writeFile('./vue.config.js',conf,'utf-8')





